package com.devinlee.designpatterns.proxy;

/**
 * 代理模式
 */
public class ProxySubject implements Subject{

    private Subject realSubject;

    public ProxySubject(Subject subject){
        this.realSubject = subject;
    }

    @Override
    public void todo(){
        System.out.println("访问前...");
        realSubject.todo();
        System.out.println("访问后...");
    }
}
